---
title: SAIF.Application.Claim business rules
summary: Enumerated business rules with per-rule trigger, enforcement, and outcomes.
status: draft
owner: SAIF Documentation Generator
last_reviewed: 2026-08-21
library: SAIF.Application.Claim
reference_type: embedded
---

# SAIF.Application.Claim business rules

This page captures business rules enforced by `SAIF.Application.Claim`.

## BR-CLM-001 Claim context key validation

| Field | Value |
| --- | --- |
| **Statement** | A claim context is only accepted when the supplied key is meaningful: a claim number must be non-blank after trimming, and a claim id or worker id must be greater than zero. |
| **Trigger** | `SetClaimContext` / `SetWorkerContext` call |
| **Enforcement** | `SetClaimContext(String)`, `SetClaimContext(Decimal)`, `SetWorkerContext(Decimal)` — `ClaimAppManager.vb` |
| **Outcome** | Invalid keys clear `ClaimData`, mark the context not set, and show "Please enter a valid claim number."; no database access occurs. `SetWorkerContext` returns silently with no message. |
| **Source** | `SAIF.Application.Claim/ClaimAppManager.vb` |

---

## BR-CLM-002 Claim context immutability

| Field | Value |
| --- | --- |
| **Statement** | Claim context values are immutable; changing context replaces the whole context object. |
| **Trigger** | Any `Set*Context` call |
| **Enforcement** | `m_Context = New ClaimContext(...)`; `ClaimContext` exposes only `ReadOnly` properties — `ClaimContext.vb`, `ClaimAppManager.vb` |
| **Outcome** | No partial-context state is possible; a manager always reflects exactly one claim/worker binding. |
| **Source** | `SAIF.Application.Claim/ClaimContext.vb` |

---

## BR-CLM-003 Fixed context-change pipeline order

| Field | Value |
| --- | --- |
| **Statement** | Every context change runs claim retrieval, then the security evaluation, then the screen retrieval — in that order. |
| **Trigger** | `ChangeContext()` after a valid `Set*Context` |
| **Enforcement** | `ChangeContext()` calls `OnContextChanged()` → `OnCheckSecurity()` → `OnRetrieve()` — `ClaimAppManager.vb` |
| **Outcome** | Security is always evaluated against a loaded claim and before any screen data is read; derived managers cannot reorder the pipeline except by overriding `ChangeContext`. |
| **Source** | `SAIF.Application.Claim/ClaimAppManager.vb` |

---

## BR-CLM-004 Context validity requires a valid retrieved claim

| Field | Value |
| --- | --- |
| **Statement** | The context counts as set only when the retrieved claim reports itself valid. |
| **Trigger** | `OnContextChanged()` |
| **Enforcement** | `Message = CLAIMNOTFOUND` + `MarkContextNotSet()`, then `If m_ClaimData.IsValid Then ... MarkContextSet()` — `ClaimAppManager.vb` |
| **Outcome** | An unknown claim leaves the manager context-less with "Error: Claim not found."; downstream `ValidContext` is `False`. |
| **Source** | `SAIF.Application.Claim/ClaimAppManager.vb` |

---

## BR-CLM-005 View-only by default

| Field | Value |
| --- | --- |
| **Statement** | A claim is view-only by default; edit rights must be granted explicitly by a derived manager. |
| **Trigger** | `OnCheckSecurity()` |
| **Enforcement** | `MarkViewOnly()` unconditionally — `ClaimAppManager.vb` (no `MarkUpdate()` call anywhere in this library) |
| **Outcome** | `IsUpdateable` is `False` after every context change unless the derived manager (e.g. `LegalManagerBase`) elevates it. |
| **Source** | `SAIF.Application.Claim/ClaimAppManager.vb` |

---

## BR-CLM-006 Conflict-claim denial with override

| Field | Value |
| --- | --- |
| **Statement** | A user without conflict-claim authority is denied all access to a worker-conflict claim unless a per-claim security override has been granted to that user. |
| **Trigger** | `OnCheckSecurity()` during a context change |
| **Enforcement** | `If Not ClaimSecurity.ConflictAccess AndAlso Not CheckForSecurityOverride() Then MarkNoAccess()` — `ClaimAppManager.vb` |
| **Outcome** | Access is set to `NoAccess` and the confidential-claim message is shown; the override grant (`ClaimServices.HasOverrideAcess`) restores view-only access. |
| **Source** | `SAIF.Application.Claim/ClaimAppManager.vb` |

---

## BR-CLM-007 Conflict-claim access flag

| Field | Value |
| --- | --- |
| **Statement** | Conflict-claim access is denied only when the claim involves a worker conflict and the user lacks the `ConflictClaim` resource. |
| **Trigger** | `ClaimSecurity.CheckClaim` |
| **Enforcement** | `If inClaim.IsWorkerConflict Then If Not UserAccess.ConflictAccess ...` — `ClaimSecurity.vb`; resource key `CONFLICTSECURITYKEY = "ConflictClaim"` — `ClaimUserAccess.vb` |
| **Outcome** | `ConflictAccess` is `False`; non-conflict claims are always accessible on this dimension. |
| **Source** | `SAIF.Application.Claim/ClaimSecurity.vb` |

---

## BR-CLM-008 Exposure-claim access flag

| Field | Value |
| --- | --- |
| **Statement** | Exposure-claim access is denied only when the claim is an exposure claim and the user lacks the `ExposureClaim` resource. |
| **Trigger** | `ClaimSecurity.CheckClaim` |
| **Enforcement** | `If inClaim.IsExposure Then If Not UserAccess.ExposureAccess ...` — `ClaimSecurity.vb` |
| **Outcome** | `ExposureAccess` is `False`; enforcement is left to consumers (e.g. `LegalManagerBase`, `clsCaseSearchManager`). |
| **Source** | `SAIF.Application.Claim/ClaimSecurity.vb` |

---

## BR-CLM-009 Health-issue access flag

| Field | Value |
| --- | --- |
| **Statement** | Health-issue access is denied only when the claim is both a health-issue claim and an exposure claim and the user lacks the `ExposureClaim` resource. |
| **Trigger** | `ClaimSecurity.CheckClaim` |
| **Enforcement** | Nested `If inClaim.IsHealthIssue Then If inClaim.IsExposure Then If Not UserAccess.ExposureAccess ...` — `ClaimSecurity.vb` |
| **Outcome** | `HealthIssueAccess` is `False`. A health-issue claim that is not an exposure claim is never restricted, and the `CollateralHealthClaim` resource is not consulted by this rule.* |
| **Source** | `SAIF.Application.Claim/ClaimSecurity.vb` |

---

## BR-CLM-010 Secure-claim access flag

| Field | Value |
| --- | --- |
| **Statement** | Secure-claim access is denied only when the claim has a hostile worker and the user lacks the `SecureClaim` resource. |
| **Trigger** | `ClaimSecurity.CheckClaim` |
| **Enforcement** | `If inClaim.IsHostileWorker Then If Not UserAccess.SecureClaimAccess ...` — `ClaimSecurity.vb` |
| **Outcome** | `SecureClaimAccess` is `False`; enforcement is left to consumers. |
| **Source** | `SAIF.Application.Claim/ClaimSecurity.vb` |

---

## BR-CLM-011 Confidential-access denial referral

| Field | Value |
| --- | --- |
| **Statement** | A confidential-access denial directs the user to the claim's adjuster whenever an adjuster name is on file. |
| **Trigger** | Denial message composition in `OnCheckSecurity` |
| **Enforcement** | `ConfidentialAccessDeniedMessage` — `ClaimAppManager.vb` |
| **Outcome** | The user sees "Please contact `<adjuster>` at `<phone>` for claim information."; otherwise the generic `ERRORCONFIDENTIALCLAIM` text. |
| **Source** | `SAIF.Application.Claim/ClaimAppManager.vb` |

---

## BR-CLM-012 Only conflict dimension auto-blocks

| Field | Value |
| --- | --- |
| **Statement** | Of the four claim-confidentiality dimensions, only the conflict dimension blocks access automatically. |
| **Trigger** | `OnCheckSecurity()` |
| **Enforcement** | Only `ClaimSecurity.ConflictAccess` is tested in `ClaimAppManager.OnCheckSecurity` — `ClaimAppManager.vb` |
| **Outcome** | Exposure, hostile-worker, and health-issue restrictions are advisory flags that each consuming manager must enforce itself.* |
| **Source** | `SAIF.Application.Claim/ClaimAppManager.vb` |

---

## BR-CLM-013 Claim database user pinned to CLM

| Field | Value |
| --- | --- |
| **Statement** | All claim applications connect to the claim database as the `CLM` database user through the `ClaimDPI` portal. |
| **Trigger** | Manager initialization |
| **Enforcement** | `DataLayer.DBUser = "CLM"` in `OnInitialize()`; `DataLayer.CreateOraclePortal(ClaimAppConstants.DPIClaimKey)` in `OnCreateDataLayer()`; `DPI` defaults to `ClaimAppConstants.DPIClaimKey` — `ClaimAppManager.vb` |
| **Outcome** | Every business object retrieved through `DPI` shares one Oracle connection identity and portal key ("ClaimDPI"). |
| **Source** | `SAIF.Application.Claim/ClaimAppManager.vb` |

---

## BR-CLM-014 Connection failure surfaces as application exception

| Field | Value |
| --- | --- |
| **Statement** | A failure to establish the claim database connection leaves the manager unusable and surfaces as an application exception. |
| **Trigger** | Exception in `CreateOraclePortal` |
| **Enforcement** | `Catch ex ... MarkContextNotSet() : MarkNoAccess() : Throw New ApplicationException("Unable to Establish Database Connection", ex)` — `ClaimAppManager.vb` |
| **Outcome** | The caller receives an `ApplicationException` with the original exception preserved, and the manager is in no-access, no-context state. |
| **Source** | `SAIF.Application.Claim/ClaimAppManager.vb` |

---

## BR-CLM-015 Single transaction per save

| Field | Value |
| --- | --- |
| **Statement** | A claim save runs inside exactly one transaction; a transaction is started only when none is already pending on the portal. |
| **Trigger** | `Write()` |
| **Enforcement** | `OnTransactionStart()` guarded by `If Not DPI.TransactionPending` — `ClaimAppManager.vb` |
| **Outcome** | Nested saves join the outer transaction instead of starting a second one. |
| **Source** | `SAIF.Application.Claim/ClaimAppManager.vb` |

---

## BR-CLM-016 Commit only on success

| Field | Value |
| --- | --- |
| **Statement** | A claim save is committed only when the write reports success; any exception or `False` result rolls the transaction back. |
| **Trigger** | `Write()` completion or failure |
| **Enforcement** | `Try/Catch/Finally` in `Write()`; `OnTransactionStop(inCommit)` → `DataLayer.DAL.EndTransaction(DPI.PortalID, inCommit)` — `ClaimAppManager.vb` |
| **Outcome** | All business-object changes in one `OnWrite()` commit or roll back together; the exception is rethrown to the caller. |
| **Source** | `SAIF.Application.Claim/ClaimAppManager.vb` |

---

## BR-CLM-017 Task generator claim binding

| Field | Value |
| --- | --- |
| **Statement** | A task generator is bound either to the claim currently in context or to multiple claims, chosen at creation time. |
| **Trigger** | `NewTaskGenerator(inMultiClaim)` |
| **Enforcement** | `If inMultiClaim Then New clsClaimTaskGenerator(DPI) Else New clsClaimTaskGenerator(DPI, ClaimData)` — `ClaimAppManager.vb` |
| **Outcome** | Single-claim generators inherit the context claim automatically; multi-claim generators require each task to carry its own claim. |
| **Source** | `SAIF.Application.Claim/ClaimAppManager.vb` |

---

## BR-CLM-018 Empty task set always saves successfully

| Field | Value |
| --- | --- |
| **Statement** | Saving tasks succeeds trivially when there are no tasks, and otherwise only when the task collection reports no errors. |
| **Trigger** | `SaveTasks()` |
| **Enforcement** | `If Tasks.Count > 0 Then Tasks.Save() : Return Tasks.ErrorCount = 0` … `Return True` — `ClaimAppManager.vb` |
| **Outcome** | An empty task set never fails a save; a partially failed task save returns `False` to the calling `OnWrite()`. |
| **Source** | `SAIF.Application.Claim/ClaimAppManager.vb` |

---

## BR-CLM-019 Valid context requires set, allowed, and valid claim

| Field | Value |
| --- | --- |
| **Statement** | A claim context is valid only when it is set, access is not denied, and the claim itself is valid. |
| **Trigger** | `ValidContext` read (e.g. from `Retrieve`) |
| **Enforcement** | `OnValidContext()` — `If ContextSet Then If Not SecurityRole = AppSecurityRole.NoAccess Then Return ClaimData.IsValid` — `ClaimAppManager.vb` |
| **Outcome** | Restricted or unknown claims report an invalid context, blocking retrieval. |
| **Source** | `SAIF.Application.Claim/ClaimAppManager.vb` |

---

## BR-CLM-020 Retrieve never reports success

| Field | Value |
| --- | --- |
| **Statement** | `Retrieve()` never reports success to its caller. |
| **Trigger** | `Retrieve()` call |
| **Enforcement** | `Public Overrides Function Retrieve() As Boolean` assigns no return value on any path — `ClaimAppManager.vb` |
| **Outcome** | The function always returns `False`; callers must judge success from `Message`, `ValidContext`, or manager state instead.* |
| **Source** | `SAIF.Application.Claim/ClaimAppManager.vb` |

---

## BR-CLM-021 Application title composition

| Field | Value |
| --- | --- |
| **Statement** | The application title shows the SAIF claim number and the injured worker's name, and is blank when no valid claim is loaded. |
| **Trigger** | `ApplicationTitle` read |
| **Enforcement** | `ApplicationTitle` — `ClaimAppManager.vb` |
| **Outcome** | Screens display "`<claim number>` - `<worker last-name-first>`" or an empty header. |
| **Source** | `SAIF.Application.Claim/ClaimAppManager.vb` |

---

## BR-CLM-022 Imaging endpoint resolved once per manager

| Field | Value |
| --- | --- |
| **Statement** | The imaging API endpoint is resolved once per manager from the `imagingapiurl` environment configuration setting. |
| **Trigger** | First `ClaimImageApiClient` access |
| **Enforcement** | `New ImagingClient(EnvironmentService.GetConfigSetting("imagingapiurl"))` — `ClaimAppManager.vb` |
| **Outcome** | All imaging calls from one manager instance use the same endpoint; a configuration change requires a new manager instance. |
| **Source** | `SAIF.Application.Claim/ClaimAppManager.vb` |

## Notes

> **Note:** Statements marked with `*` were inferred from code structure, naming conventions, or
> contextual evidence where direct confirmation was not available in source artifacts. Statements
> marked with `**` could not be confirmed; treat as unknown until verified.

## Related documentation
- [Index](index.md)
- [Overview](overview.md)
- [Architecture](architecture.md)
- [Dependencies](dependencies.md)
- [Configuration](configuration.md)
- [Operations and processes](operations-processes.md)
- [Security and authorization](security-authorization.md)
- [API reference](api/index.md)

> **Note:** Statements marked with * were inferred from code structure, naming conventions, or
> contextual evidence where direct confirmation was not available in source artifacts. Statements
> marked with ** could not be confirmed; treat as unknown until verified.

## Sources
- `SAIF.Application.Claim/ClaimAppManager.vb`
- `SAIF.Application.Claim/ClaimSecurity.vb`
- `SAIF.Application.Claim/ClaimUserAccess.vb`
- `SAIF.Application.Claim/ClaimContext.vb`
- `SAIF.Application.Claim/ClaimAppConstants.vb`
